<template>
	<u--form labelPosition="left" labelWidth="100" ref="form1">
		<dateTimePicker @getdata="getstartdate">
			<u-form-item label="开始时间" borderBottom ref="item1">
				<u--input class="inputx" disabledColor="#ffffff" placeholder="请选择开始时间" disabled v-model="startdate"
					inputAlign="right" border="none"></u--input>
				<u-icon name="arrow-right"></u-icon>
			</u-form-item>
		</dateTimePicker>
		<dateTimePicker @getdata="getenddate">
			<u-form-item label="到期时间" borderBottom ref="item1">
				<u--input class="inputx" disabledColor="#ffffff" placeholder="请选择到期时间" disabled v-model="enddate"
					inputAlign="right" border="none"></u--input>
				<u-icon name="arrow-right"></u-icon>
			</u-form-item>
		</dateTimePicker>
	</u--form>
</template>

<script>
	import moment from 'moment'
	import dateTimePicker from './dateTimePicker.vue'
	export default {
		components: {
			dateTimePicker
		},
		data() {
			return {
				startdate: '',
				enddate: '',
			};
		},
		methods: {
			getenddate(e) {
				if (e.value) {
					this.enddate = moment(e.value).format("YYYY-MM-DD")
				}
			},
			getstartdate(e) {
				if (e.value) {
					this.startdate = moment(e.value).format("YYYY-MM-DD")
				}
			}
		}
	};
</script>
